@echo off

set SSH_PATH=%USERPROFILE%\.ssh
set SSH_KEY_PATH=%SSH_PATH%\id_ed25519
set KEY_PATH=ssh_key

if not exist %KEY_PATH% (
    echo error: Unable to find key file!
    pause
    exit /d
)
if not exist %SSH_PATH% mkdir %SSH_PATH%
if not exist %SSH_KEY_PATH% (
    type %KEY_PATH% > %SSH_KEY_PATH%
    echo Key created successfully!
) else (
    echo error: private key file is exist "%SSH_KEY_PATH%"
    pause
)

